/*
Guillaume COLLOMBET
*/

#include <stdio.h>
#include "image.h"

int testRegression();

int main()
{
    testRegression();
    Image im, imb;
    Pixel color = { 255, 128, 0 };
    Pixel color2 = { 255, 128, 255 };
    Pixel color3 = { 0, 128, 255 };

    imInit(&im,50,50);
    imEffacer(&im, &color);
    setPix(&im, 2, 2, &color2);
    imPrintf(&im);
    imSauver(&im, "toto.ppm");
    imOuvrir( &imb, "toto.ppm");
    imDessineRect( &imb, 5, 5, 15, 10, &color3);
    imDessineRect( &imb, 25, 25, 35, 45, &color3);
    imSauver( &imb, "titi.ppm");

    return 0;
}

int testRegression()
{
    Pixel bleu = { 0, 0, 255 };
    Pixel blanc = { 255, 255, 255 };
    Pixel rouge = { 255, 0, 0 };

    Image im;
    imInit(&im,24,12);
    imEffacer(&im, &rouge);
    imDessineRect(&im, 0,0,8,12, &bleu);
    imDessineRect(&im, 8,0,8,12, &blanc);
    imSauver( &im, "drapeau.ppm");
}
